/**
 * 讲义控制器
 */
angular
.module('myApp')
.controller('itemPageController', function($scope, $window, $routeParams, classManager) {

  $scope.$watch('windowHeight', function(value) {
    $scope.iframeStyle = {
      height: value + 'px'
    }
  });

  $scope.windowHeight = $window.innerHeight;

  angular.element($window).bind('resize', function() {
    $scope.windowHeight = $window.innerHeight;
    $scope.$digest();
  });

  classManager.getCourse($routeParams.id, 2)
    .then(function(data) {
      if (data.length > 0) {
        $scope.data = data[0];
      }
    });
});
 